import { axios } from '@/utils/request'

const api = {
  getOrderList: '/adopt/adopt-cost-order/list',
  handleOrderCancel: '/adopt/adopt-cost-order/apply-order-delete',
  handleOrderSend: '/adopt/adopt-cost-order/send',
  handleOrderConfirm: '/adopt/adopt-cost-order/confirm',
  handleOrderPrint: '/adopt/adopt-cost-order/print-order',
  handleOrderClerk: '/adopt/adopt-cost-order/clerk',
  setSellerComments: '/adopt/adopt-cost-order/seller-comments',
  setOrderAddress: '/adopt/adopt-cost-order/set-order-address',
  getRefundList: '/adopt/adopt-cost-order/refund',
  orderRefund: '/adopt/adopt-cost-order/refund-handle',
  commentList: '/adopt/adopt-cost-order/comment-list',
  commentReply: '/adopt/adopt-cost-order/comment-reply',
  commentHide: '/adopt/adopt-cost-order/comment-hide',
  commentDelete: '/adopt/adopt-cost-order/comment-delete',
  addComment: '/adopt/adopt-cost-order/comment-edit',
  setPrice: '/adopt/adopt-cost-order/modify-price',
  table: '/adopt/adopt-cost-order/table',
  edit: '/adopt/adopt-cost-order/edit',
  print: '/adopt/adopt-cost-order/print',
  expressDetail: '/adopt/adopt-cost-order/express-detail',
  updateShop: '/adopt/adopt-cost-order/update-shop',
  setWords: '/adopt/adopt-cost-order/set-words',
  // 转单平台
  transOrder: 'md/trans-order',
  // 核销订单
  clerkOrder:'/adopt/adopt-cost-order/clerk'
}

export default api


export function transOrder(parameter) {
  return axios({
    url: api.transOrder,
    method: 'post',
    data: parameter
  })
}

export function getOrderList (parameter) {
  return axios({
    url: api.getOrderList,
    method: 'get',
    params: parameter
  })
}

export function orderCancel (parameter) {
  return axios({
    url: api.handleOrderCancel,
    method: 'post',
    data: parameter
  })
}

export function orderSend (parameter) {
  return axios({
    url: api.handleOrderSend,
    method: 'post',
    data: parameter
  })
}

export function orderConfirm (parameter) {
  return axios({
    url: api.handleOrderConfirm,
    method: 'post',
    data: parameter
  })
}

export function orderPrint (parameter) {
  return axios({
    url: api.handleOrderPrint,
    method: 'post',
    data: parameter
  })
}

export function orderClerk (parameter) {
  return axios({
    url: api.handleOrderClerk,
    method: 'post',
    data: parameter
  })
}

export function setComments (parameter) {
  return axios({
    url: api.setSellerComments,
    method: 'get',
    params: parameter
  })
}

export function setAddress (parameter) {
  return axios({
    url: api.setOrderAddress,
    method: 'post',
    data: parameter
  })
}

export function refundList (parameter) {
  return axios({
    url: api.getRefundList,
    method: 'get',
    params: parameter
  })
}

export function refundOrder (parameter) {
  return axios({
    url: api.orderRefund,
    method: 'post',
    data: parameter
  })
}

export function getComment (parameter) {
  return axios({
    url: api.commentList,
    method: 'get',
    params: parameter
  })
}

export function handleCommentReply (parameter) {
  return axios({
    url: api.commentReply,
    method: 'post',
    data: parameter
  })
}

export function handleCommentHide (parameter) {
  return axios({
    url: api.commentHide,
    method: 'post',
    data: parameter
  })
}

export function handleCommentDelete (parameter) {
  return axios({
    url: api.commentDelete,
    method: 'post',
    data: parameter
  })
}

export function handleEditComment (parameter) {
  return axios({
    url: api.addComment,
    method: 'post',
    data: parameter
  })
}

export function setWords (parameter) {
  return axios({
    url: api.setWords,
    method: 'post',
    data: parameter
  })
}

export function modifyPrice (parameter) {
  return axios({
    url: api.setPrice,
    method: 'post',
    data: parameter
  })
}

export function orderTable (parameter) {
  return axios({
    url: api.table,
    method: 'get',
    params: parameter
  })
}

export function orderEdit (parameter) {
  return axios({
    url: api.edit,
    method: 'get',
    params: parameter
  })
}

// 电子面单打印
export function orderPrintMd (parameter) {
  return axios({
    url: api.print,
    method: 'get',
    params: parameter
  })
}

// 订单物流查询
export function orderExpress (parameter) {
  return axios({
    url: api.expressDetail,
    method: 'get',
    params: parameter
  })
}

// 切换社区
export function UpdateShop (parameter) {
  return axios({
    url: api.updateShop,
    method: 'get',
    params: parameter
  })
}

// 核销订单

export function clerkOrder (parameter) {
  return axios({
    url: api.clerkOrder,
    method: 'post',
    data: parameter
  })
}